package cn.iocoder.yudao.module.gold.convert.warehouse;


import cn.iocoder.yudao.module.system.controller.admin.warehouse.vo.GoldInReqVO;
import cn.iocoder.yudao.module.system.controller.admin.warehouse.vo.GoldMaterialWarehouseRespVO;
import cn.iocoder.yudao.module.system.controller.admin.warehouse.vo.GoldMaterialWarehouseSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.warehouse.GoldMaterialRecordDO;
import cn.iocoder.yudao.module.system.dal.dataobject.warehouse.GoldMaterialWarehouseDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface GoldMaterialWarehouseConvert {
    GoldMaterialWarehouseConvert INSTANCE = Mappers.getMapper(GoldMaterialWarehouseConvert.class);

    GoldMaterialWarehouseDO convert(GoldMaterialWarehouseSaveReqVO bean);
    GoldMaterialWarehouseRespVO convert(GoldMaterialWarehouseDO bean);
    List<GoldMaterialWarehouseRespVO> convertList(List<GoldMaterialWarehouseDO> list);
    /**
     * 买料入料请求 VO 转 DO
     */
    GoldMaterialRecordDO convert(GoldInReqVO reqVO);

    /**
     * 销售回料请求 VO 转 DO
     */
    default GoldMaterialRecordDO convertToSalesReturn(GoldInReqVO reqVO) {
        GoldMaterialRecordDO record = convert(reqVO);
        // 可以在这里设置销售回料特有的字段
        return record;
    }
}